_package("alz.gesture");

/**
 * 触摸事件
 */
_class("TouchEventObjectImpl", "", function(){
	this._init = function(ev){
		_super._init.call(this);
		if(ev){
			this.setEvent(ev);
		}
	};
	this.setEvent = function(ev){
		this.event = ev;
		this.time = ev.timeStamp;
		this.touches = ev.touches || [ev];
		this.changedTouches = ev.changedTouches || [ev];
		this.targetTouches = ev.targetTouches || [ev];
		this.target = ev.target;
		return this;
	};
	this.stopEvent = function(){
		this.stopPropagation();
		this.preventDefault();
	};
	this.stopPropagation = function(){
		this.event.stopped = true;
	};
	this.preventDefault = function(){
		this.event.preventDefault();
	};
	/*
	this.getTarget = function(selector, maxDepth, returnEl){
		if(selector){
			return Ext.fly(this.target).findParent(selector, maxDepth, returnEl);
		}else{
			return returnEl ? Ext.get(this.target) : this.target;
		}
	};
	*/
});